﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace Projet_IMA.Habillage
{
    public class TextureBump : Texture
    {
        public float Alpha;

        public TextureBump(string ff, float Alpha)
            : base(ff)
        {
            this.Alpha = Alpha;
        }

        // u,v compris entre 0 et 1

        public void BumpValue(float u, float v, out float dhdu, out float dhdv)
        {
            float x = u * Hauteur;
            float y = v * Largeur;

            float vv = Interpol(x, y).GreyLevel();
            float vx = Interpol(x + 1, y).GreyLevel();
            float vy = Interpol(x, y + 1).GreyLevel();

            dhdu = vx - vv;
            dhdv = vy - vv;
        }
    }
}
